wifi: don't auto power down the transceiver when power save is disabled - #2681
Merged
Arisotura merged 1 commit intoJun 7, 2026
Merged
Conversation
…bled
sleep mode 2 ("power saving disabled", used by dswifi in infrastructure
mode) was treated like automatic mode: when the one-shot W_BeaconCount2
countdown armed at wifi init (0xFFFF TUs = ~67s) reached zero, IRQ13
powered the transceiver off. stations running with power saving disabled
never service IRQ13/IRQ15, so nothing ever turned it back on, silently
killing all wifi traffic ~67 seconds after init. real hardware does not
power down in this mode.
Contributor
|
I've created an issue in BlocksDS to investigate switching to automatic power saving mode: https://codeberg.org/blocksds/sdk/issues/379 |
Member
|
oh, good catch |
Zection6V
pushed a commit
to ag-advania/melonPrimeDS
that referenced
this pull request
Aug 13, 2026
…bled (melonDS-emu#2681) sleep mode 2 ("power saving disabled", used by dswifi in infrastructure mode) was treated like automatic mode: when the one-shot W_BeaconCount2 countdown armed at wifi init (0xFFFF TUs = ~67s) reached zero, IRQ13 powered the transceiver off. stations running with power saving disabled never service IRQ13/IRQ15, so nothing ever turned it back on, silently killing all wifi traffic ~67 seconds after init. real hardware does not power down in this mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2680
dswifi in infrastructure mode runs with power saving disabled (
W_MODE_WEPsleep mode 2), but arms the one-shotW_BeaconCount2countdown at 0xFFFF TUs (≈67s) during init.SetIRQ13()exempted only sleep mode 3 from auto power-down, so when the countdown ran out the transceiver was powered off and since stations with power saving disabled don't service IRQ13/IRQ15, nothing ever woke it back up. All wifi traffic silently died ~67s after init.This restricts the auto power-down to automatic power saving mode (0). Real hardware does not power down in mode 2 (verified with the repro ROM from the issue: dies at ~67s on melonDS, runs indefinitely on a real DS).
I wasn't sure whether mode 1 should also auto-sleep happy to adjust if the intended semantics are different.
Tested: repro ROM from #2680 on macOS, master build radio stays alive well past the 67s mark (>4 min soak); unpatched build dies on schedule.